#include "create_new_avatar_dlg.h"
#include "ui_create_new_avatar_dlg.h"

CreateNewAvatarDlg::CreateNewAvatarDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CreateNewAvatarDlg)
{
    ui->setupUi(this);

    ui->pushButton->setEnabled(false);
}

CreateNewAvatarDlg::~CreateNewAvatarDlg()
{
    delete ui;
}

QString CreateNewAvatarDlg::GetAvatarName()
{
    return ui->lineEdit->text();
}

void CreateNewAvatarDlg::on_lineEdit_textChanged(const QString &arg1)
{
    ui->avatar_widget->SetName(arg1);

    ui->pushButton->setEnabled(!ui->lineEdit->text().isEmpty());
}

void CreateNewAvatarDlg::on_pushButton_2_clicked()
{
    emit sig_reject();
}

void CreateNewAvatarDlg::on_pushButton_clicked()
{
    emit sig_accept();
}

